#include<iostream>
using namespace std;
int cou()
{
	char s[1000];
	int x = 0,n=0;

	
	while ((s[n] = getchar())!= '\n')
	{
		while ((s[n] = getchar()) = ')')
		{
			x = x -1;
		}
		while ((s[n] = getchar()) = '(')
		{
			x = x + 1;
		}
		x = x + 1;
	}
	if (x = 0)
	{
		cout << "1";
	}
	else
		cout << "0";
	return 0;
}